package se19team1e.controller;

import se19team1e.entity.JobResponseDTO;
import se19team1e.gui.JobAdvertResponseDetailScreen;
import se19team1e.gui.awt.AWTBaseScreen;

/**
 * 
 * Class to view the the job response details. Extends the base controller.
 * 
 * @author Tay Toh Tong
 * 
 */
public class ViewJobResponseDetailController extends BaseController {
	private JobResponseDTO jobResponse;
	private AWTBaseScreen previousScreen;
	private Application application;

	/**
	 * To create the GUI when controller is invoked.
	 * 
	 * @param jobResponse
	 *            The job response DTO
	 * @param previousScreen
	 * @param application
	 */
	public ViewJobResponseDetailController(JobResponseDTO jobResponse,
			AWTBaseScreen previousScreen, Application application) {
		super(application);
		this.jobResponse = jobResponse;
		this.previousScreen = previousScreen;
		this.application = application;

		// get screen
		JobAdvertResponseDetailScreen screen = application
				.getScreen(JobAdvertResponseDetailScreen.class);

		// initialize screen
		screen.initialize(this, this.jobResponse);

		// set as active screen
		application.setCurrentScreen(screen);
	}

	/**
	 * To return control of GUI to the previous screen
	 */

	public void backToPreviousScreen() {
		application.setCurrentScreen(this.previousScreen);
	}
}
